package sharemem

const (
	UNIT_TOUGHBUFF_MAX	=	4
)

type Monster struct {
	Id         int32
	Order     [UNIT_ORDERS_MAX]Id_time
	Ex_skill	int32
	Passive    [UNIT_PASSIVE_MAX]int32
	Tough_time	int32
	Tough_buff	[UNIT_TOUGHBUFF_MAX]int32
	Type       int8
	Weak_point [UNIT_WEAK_MAX]int8
	Attr       int32
}

func (tmp *Monster) meminit() {
	var i int32
	tmp.Id = 0
	for i = 0; i < UNIT_ORDERS_MAX; i++ {
		tmp.Order[i].meminit()
	}
	tmp.Ex_skill = 0
	for i = 0; i < UNIT_PASSIVE_MAX; i++ {
		tmp.Passive[i] = 0
	}
	tmp.Tough_time = 0
	for i=0;i<UNIT_TOUGHBUFF_MAX;i++ {
		tmp.Tough_buff[i] = 0
	}
	tmp.Type = 0
	for i = 0; i < UNIT_WEAK_MAX; i++ {
		tmp.Weak_point[i] = 0
	}
	tmp.Attr = 0
}
func (tmp *Monster) isUse() bool {
	return tmp.Id > 0
}
func (tmp *Monster) getId() int32 {
	return tmp.Id
}

func Get_config_monster(id int32) *Monster {
	v, ok := GetConfigMonsterMap()[id]
	if !ok {
		return nil
	}

	return v
}
